package com.zhehekeji.opsys.api.enm;

/**
 * @author chenweiliu chenwei.liu@163.com
 * @ClassName DefinitionFlag
 * @Description TODO
 * @date 2016-1-18   下午5:13:17
 */
public enum DefinitionFlag {
    /**
     * 标清
     */
    BIAO_QING(0, "标清"),
    /**
     * 高清
     */
    GAO_QING(1, "高清"),
    /**
     * 超清
     */
    CHAO_QING(2, "超清"),
    /**
     * 4K
     */
    FOUR_K(3, "4K"),
    /**
     * 杜比
     */
    DU_BI(4, "杜比");
    private int flag;
    private String desc;

    private DefinitionFlag(int flag, String desc) {
        this.flag = flag;
        this.desc = desc;
    }

    public int getFlag() {
        return this.flag;
    }

    public String getDesc() {
        return this.desc;
    }

    public static String toDesc(Integer flag) {
        if (flag == null) {
            return BIAO_QING.desc;
        }
        if (flag == BIAO_QING.flag) {
            return BIAO_QING.desc;
        }
        if (flag == GAO_QING.flag) {
            return GAO_QING.desc;
        }
        if (flag == CHAO_QING.flag) {
            return CHAO_QING.desc;
        }
        if (flag == FOUR_K.flag) {
            return FOUR_K.desc;
        }
        if (flag == DU_BI.flag) {
            return DU_BI.desc;
        }
        return BIAO_QING.desc;
    }
}

